

$(function () {
    // 粒子线条背景
    $(document).ready(function () {
        $('.layui-container').particleground({
            dotColor: '#7ec7fd',
            lineColor: '#7ec7fd'
        })
    })
    //登录
    $('.layui-form').submit(function (e) {
        e.preventDefault();
        var zm = $(this).serialize()
        $.ajax({
            type: 'post',
            url: 'api/login',
            data: zm,
            success: function (res) {
                if (res.status===0) {
                    localStorage.setItem('mytoken',res.token)
                    //跳转
                    location.href='./index.html'
                 }else{
                     layer.msg(res.message)
                 }

            }
        })
    })
});